/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package my.javax.microedition.contactless.ndef;

import com.ericsson.nfc.jsr257.impl.NDEFMessageImpl;

/**
 *
 * @author emarkki
 */
public class NDEFMessage {

    private NDEFMessageImpl impl;
    
    public NDEFMessage(NDEFRecord[] records) {
        this.impl = new NDEFMessageImpl(records);
    }

    /**
     * Creates an NDEF message from the byte array starting from the specified offset in the byte array.
     * @param data
     * @param offset
     */
    public NDEFMessage(byte[] data, int offset) {
        this.impl = new NDEFMessageImpl(data, offset);
    }

    public int getNumberOfRecords() {
        return impl.getNumberOfRecords();
    }

    public NDEFRecord getRecord(int i) {
        return impl.getRecord(i);
    }

    public NDEFRecord[] getRecords() {
        return impl.getRecords();
    }

    public byte[] toByteArray() {
        return impl.toByteArray();
    }

}
